<?php

namespace App\Http\Requests\Logic\Consociation;

use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;

class UpdateResource extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

	/**
	 * 定义表单验证规则
	 *
	 * Date: 11/04/2018
	 * @author George
	 * @return array
	 */
    public function rules()
    {
        return [
            'comment' => 'nullable',
            'partner_buttman' => 'nullable',
            'partner_contact' => 'nullable',
            'status' => [
                'required',
                Rule::in(array_keys(config('system.consociation.status')))
            ],
        ];
    }

	/**
	 * 定义表单验证消息
	 *
	 * Date: 11/04/2018
	 * @author George
	 * @return array
	 */
	public function messages()
	{
        return [
            'status.required' => '请勿修改参数',
            'status.in' => '请勿修改参数',
        ];
    }
}
